<?php
date_default_timezone_set('PRC');//
$t=time();
$today=date('Y-m-d H:i:s',$t);
include"conn.php";
$name=$_POST['name']; 
$content=$_POST['content'];
$sql="insert into  notes(name,content,addtime) value('$name','$content','$today')";
$rs=$mylink->query($sql);//$rs如果成功，rs为真   如果失败   rs为假
 if ($rs)

    {
        echo "<script language='javascript' type='text/javascript'>";        
        echo "window.location.href='index.php'";
        echo "</script>";
    }
 else 
    {
        echo "<script language='javascript' type='text/javascript'>";
        echo "alert('愿望发布失败！');";
        echo "window.location.href='index.php'";
        echo "</script>";
    }

